#include "segmentationDialog.h"
#include "ui_segmentationDialog.h"
#include "segmentation.h"
#include "mainapp.h"
#include <QDebug>

SegmentationDialog::SegmentationDialog(QDialog *parent, MainApp *_app) : QDialog(parent), ui(new Ui::SegmentationDialog)
{
    ui->setupUi(this);
    m_MainApp = _app;
    ready4Seg = false;
}
SegmentationDialog::~SegmentationDialog()
{
    delete ui;
}
void SegmentationDialog::on_pushButton_clicked(){

    hide();
    qDebug() << "pusznięty";
    //m_MainApp->DoNonLinearFilter(ui->lineEdit->text().toInt());
    if (ui->chckbJustOne->isChecked()){

        allSegments=false;
        qDebug() <<"z klikniecia" <<allSegments;
        tolerance=ui->spinBox->value();
        qDebug() << "tylko jeden";
        //m_MainApp->m_Img->m_Segmentation->AllSegments(false);
        //return false;
    }
    else if (ui->chckbAll->isChecked()){
        qDebug() << "wszystkie";
        allSegments = true;
        tolerance=ui->spinBox->value();
        //m_MainApp->m_Img->m_Segmentation->AllSegments(true);
        //return true;
    }
    ready4Seg = true;
    qDebug()<<ready4Seg;
    /*else{
        qDebug() << "Nic nie wybrałeś, zrobi się dla jednego";
        //return false;
    }*/


}
